<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
	<!DOCTYPE html>
<html class="no-js">
<head>
	<meta name="author" content="蓝凌科技">
	<meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
	<meta name="renderer" content="webkit"/>
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link href="/Public/Blovex4/css/amazeui.css" rel="stylesheet">
	<link href="/Public/Blovex4/css/amaze.css" rel="stylesheet">
	<link href="/Public/Blovex4/css/admin.css" rel="stylesheet">
	<link href="/Public/Blovex4/css/jquery.datetimepicker.css" rel="stylesheet">
	<link href="/Public/Blovex4/css/custom.css" rel="stylesheet">
	<link href="/Public/Common/css/amazeui.datetimepicker.css" rel="stylesheet">
	<title><?php echo C('WEB_SITE_TITLE');?></title>
	
	<script type="text/javascript">
	    var _root = '<?php echo ($_site_url); echo U(' / ');?>', _controller = '<?php echo ($_controller); ?>';
	</script>
	
	
	

	<!-- 页面header钩子，一般用于加载插件CSS文件和代码 -->


</head>
<body  style="overflow:hidden;">
	<!-- 头部 -->
	<!-- 导航条
================================================== -->
<header id="amz-header" class="am-topbar am-topbar-fixed-top" >
    <div class="am-g">
        <div class="col-md-2 am-u-md-2">
            <h1>
            	<a href="#" target="_blank">帮工小哥</a>
            	<span class="am-badge am-badge-danger"><?php echo (C("APP_VERSION")); ?></span>
            </h1>
        <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#topbar-collapse'}">
            <span class="am-sr-only">导航切换</span>
            <span class="am-icon-bars"></span>
        </button>
		</div>
        
        <div class="col-md-10 am-u-md-10">
           
            <div class="am-collapse am-topbar-collapse" id="topbar-collapse">
            	<ul class="amz-header-nav am-topbar-nav">
                    <?php if(is_array($__MENU__['main_menu'])): foreach($__MENU__['main_menu'] as $key=>$vo): ?><li>
                            <a href="<?php echo (U($vo["menu_url"])); ?>" style="outline:none;"><?php echo ($vo["menu_name"]); ?></a>
                        </li><?php endforeach; endif; ?>
                   
                </ul>
                <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list">
                    <li>
                        <a href="<?php echo U('Public/logout');?>"><span class="am-icon-sign-out" style="color:white;">注销</span></a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</header>


	<style type="text/css">
		ul li{
			
			list-style:none;
		}
	</style>
	

	<!-- /头部 -->
	
	<!-- 主体 -->
	<div class="am-cf am-g">
    <!--左边开始---->
    <div class="am-u-sm-2 am-u-md-2 am-u-lg-2 admin-sidebar am-offcanvas am-offcanvas-style" id="admin-offcanvas">
        <div class="am-offcanvas-bar admin-offcanvas-bar left-style" >
   
	<div class="am-g admin-style">
        <div class="am-u-sm-4">
            <a href="#" class="am-icon-btn am-secondary  am-icon-drupal"></a>
        </div>
        <div class="am-u-sm-8">
            <?php echo ($ADMIN_NAME); ?>
            <br/>
            <a style="cursor:pointer;" title="退出" href="<?php echo U('Public/logout');?>"><span class="am-icon-power-off"></span></a>
            &nbsp; <a style="cursor:pointer;" title="修改密码" href="<?php echo U('Index/updatePassword');?>"><span class="am-icon-lock"></span></a>
        </div>
    </div>
    <ul class="am-list" >
        <?php if(is_array($__MENU__['_child'])): foreach($__MENU__['_child'] as $key=>$sub_menu): if(!empty($sub_menu)): ?><li>
            <a href="<?php echo (U($sub_menu["menu_url"])); ?>"><span class="<?php echo ((isset($sub_menu["menu_icon"]) && ($sub_menu["menu_icon"] !== ""))?($sub_menu["menu_icon"]):''); ?>">&nbsp;</span><?php echo ($sub_menu["menu_name"]); ?><span class="<?php echo ((isset($sub_menu["menu_style"]) && ($sub_menu["menu_style"] !== ""))?($sub_menu["menu_style"]):''); ?>"></span></a>
            <?php if(is_array($sub_menu['_child'])): foreach($sub_menu['_child'] as $key=>$menuname): ?><li class="am-margin-horizontal">
                    <a href="<?php echo (U($menuname["menu_url"])); ?>"><span class="<?php echo ((isset($menuname["menu_icon"]) && ($menuname["menu_icon"] !== ""))?($menuname["menu_icon"]):''); ?>">&nbsp;</span><?php echo ($menuname["menu_name"]); ?><span class="<?php echo ((isset($menuname["menu_style"]) && ($menuname["menu_style"] !== ""))?($menuname["menu_style"]):''); ?>"></span></a>
                </li><?php endforeach; endif; endif; ?>
        </li><?php endforeach; endif; ?>
    </ul>
</div>

    </div><!--左边结束---->
    <div class="am-u-sm-10 am-u-md-10 am-u-lg-10 custom-left am-fr" id="Contename"   >
        <div id="top-alert" class="fixed alert alert-error am-u-sm-12 am-u-md-12" style="display:none">
            <button class="close fixed" style="margin-top: 4px;">
                &times;
            </button>
            <div class="alert-content">
                这是内容
            </div>
        </div>
        
	<div class="am-cf am-padding-top">
        <div class="am-fl am-cf">
            <i class="am-icon-pencil-square-o"></i>
            <strong class="am-text-primary am-text-lg">
               <?php if(!empty($workerModel)): ?>编辑<?php else: ?>新增<?php endif; ?>小哥
            </strong>
        </div><hr data-am-widget="divider" class="am-divider am-divider-default" />
    </div>
                <form class="am-form" method="post" action="<?php echo U('saveAction');?>">
                    <div class="am-g am-margin-top">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            账号
                        </div>
                        <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                            <input type="text" class="am-input-sm"  required
                            	name="account" value="<?php echo ($workerModel['account']); ?>" pattern="^1(3|4|5|7|8)\d{9}$"
                            	<?php if(!empty($workerModel['account'])): ?>readonly<?php endif; ?>>
                        </div>
                        <div class="am-hide-sm-only am-u-md-6">
                        </div>
                    </div>
                    <div class="am-g am-margin-top">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            姓名
                        </div>
                        <div class="am-u-sm-8 am-u-md-4">
                            <input type="text" class="am-input-sm" name="name" value="<?php echo ($workerModel['name']); ?>" required/>
                        </div>
                        <div class="am-hide-sm-only am-u-md-6">
                        </div>
                    </div>
                    <div class="am-g am-margin-top">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            工号
                        </div>
                        <div class="am-u-sm-8 am-u-md-4">
                            <input type="text" class="am-input-sm" name="eid" value="<?php echo ($workerModel['eid']); ?>"/>
                        </div>
                        <div class="am-hide-sm-only am-u-md-6">
                        </div>
                    </div>
                    <div class="am-g am-margin-top">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            性别 
                        </div>
                        <div class="am-u-sm-8 am-u-md-3">
                            <input type="radio" name="sex" value="1"/>男<input type="radio" name="sex" value="2"/>女 
                        </div>
                        <div class="am-hide-sm-only am-u-md-6">
                        </div>
                    </div>
                    <div class="am-g am-margin-top">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            身份证号 
                        </div>
                        <div class="am-u-sm-8 am-u-md-3">
                            <input type="text" class="am-input-sm" name="id_number" value="<?php echo ($workerModel['id_number']); ?>"/>
                        </div>
                        <div class="am-hide-sm-only am-u-md-6">
                        </div>
                    </div>
                    <div class="am-g am-margin-top">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            出生日期 
                        </div>
                        <div class="am-u-sm-8 am-u-md-3">
                            <input type="text" class="am-input-sm am-modal-prompt-input" 
		                    	data-am-datepicker="{format: 'yyyy-mm-dd'}" name="birthday" 
		                    	value="<?php echo (GetDateMk($workerModel['birthday'])); ?>" pattern="^\d{4}-\d{1,2}-\d{1,2}$"/>
                        </div>
                        <div class="am-hide-sm-only am-u-md-6">
                        </div>
                    </div>
                    <div class="am-g am-margin-top">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            工作年限 
                        </div>
                        <div class="am-u-sm-8 am-u-md-3">
                            <input type="number" min="0" step="1" class="am-input-sm" name="work_year" 
                            	value="<?php echo ($workerModel['work_year']); ?>"/>
                        </div>
                        <div class="am-hide-sm-only am-u-md-6">
                        </div>
                    </div>
                    <div class="am-g am-margin-top">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            职业
                        </div>
                        <div class="am-u-sm-8 am-u-md-4">
                        	<select name="job" id="job"
		                    	data-am-selected="{btnSize: 'sm', btnStyle: 'secondary',maxHeight: 200}" required>
	                            <?php $_result=get_dictionary_enum('job_options');if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($key); ?>"><?php echo ($vo["enum_name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
	                        </select>
                        </div>
                        <div class="am-hide-sm-only am-u-md-6">
                        </div>
                    </div>
                    <div class="am-g am-margin-top">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            技术专长
                        </div>
                        <div class="am-u-sm-8 am-u-md-4">
                        	<select name="skill[]" id="skill[]" multiple required
		                    	data-am-selected="{btnSize: 'sm', btnStyle: 'secondary',maxHeight: 200}" minchecked="1">
	                            <?php $_result=get_dictionary_enum('profession_options');if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($key); ?>"
	  									<?php if(in_array(($key), is_array($workerModel['profession'])?$workerModel['profession']:explode(',',$workerModel['profession']))): ?>selected<?php endif; ?>><?php echo ($vo["enum_name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
	                        </select>
                        </div>
                        <div class="am-hide-sm-only am-u-md-6">
                        </div>
                    </div>
                    <!-- 0:禁止登录；1：正常；2：闲散小哥新注册，待完善信息；；3：闲散小哥已完善信息，待审核状态；
                    4：客服审核通过，已给闲散小哥发送短信通知，待培训状态（培训通过并修改所属站点后即变成 status = 1 正常状态；5.后台新增自有团队成员初始状态；-->
                    <?php if($workerModel["status"] == '3'): ?><div class="am-g am-margin-top">
	                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
	                            培训地点
	                        </div>
	                        <div class="am-u-sm-8 am-u-md-4">
		                        <select name="training_id" 
		                        	data-am-selected="{btnSize: 'sm', maxHeight: 200, searchBox:1}">
	                                <?php if(is_array($trainingList)): foreach($trainingList as $key=>$training): ?><option value="<?php echo ($training["training_id"]); ?>"><?php echo ($training["name"]); ?></option><?php endforeach; endif; ?>
	                            </select>
	                        </div>
	                        <div class="am-hide-sm-only am-u-md-6">
	                        </div>
	                    </div>
                        <div class="am-g am-margin-top">
	                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
	                            培训时间
	                        </div>
	                        <div class="am-u-sm-8 am-u-md-4">
	                        	<div class="am-input-group date form_datetime-1"
			                    	 data-date="" data-date-format="yyyy-mm-dd hh:ii">
	  								<input size="16" type="text" class="am-form-field" pattern="^\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2}$"
	  								 	name="training_time" id="training_time" value="<?php echo (date('Y-m-d H:i', $workerModel['training_time'])); ?>">
	  								<span class="am-input-group-label add-on"><i class="icon-th am-icon-calendar"></i></span>
								</div>
	                        </div>
	                        
	                        <div class="am-hide-sm-only am-u-md-6">
	                        </div>
	                    </div>
                    <?php elseif($workerModel["status"] != '2'): ?>		
	                    <div class="am-g am-margin-top">
	                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
	                            所在站点
	                        </div>
	                        <div class="am-u-sm-8 am-u-md-4">
		                        <select name="site_id" data-am-selected="{btnSize: 'sm', maxHeight: 200, searchBox:1}" required>
	                                <?php if(is_array($siteList)): foreach($siteList as $key=>$site): ?><option value="<?php echo ($site["site_id"]); ?>"><?php echo ($site["site_name"]); ?></option><?php endforeach; endif; ?>
	                            </select>
	                        </div>
	                        <div class="am-hide-sm-only am-u-md-6">
	                        </div>
	                    </div><?php endif; ?>
                    
                    <div class="am-g am-margin-top">
		                <div class="am-u-sm-4 am-u-md-2 am-text-right">
		                    小哥简介
		                </div>
		                <div class="am-u-sm-8 am-u-md-8">
		                    <textarea rows="8" name="description" id="description" class="am-input-sm" 
		                    	required><?php echo ($workerModel['description']); ?></textarea>
		                </div>
		                <div class="am-hide-sm-only am-u-md-2">
		                </div>
		            </div>
                    
                    <div class="am-g am-margin-top-sm">
                		<div class="am-u-sm-4 am-u-md-2 am-text-right">
                    头像
                		</div>
                		<div class="am-u-sm-8 am-u-md-3 am-u-end">
                    		<div class="am-form-group am-form-file">
                        		<input type="file" name="pict_cover" id="pict_cover"/>
								<input type="hidden" name="att_id" id="att_id" value="<?php echo ($workerModel['att_id']); ?>"/>
                    		</div>
                    		<div id="photo_thumbnail">
		                        <?php if(!empty($workerModel['att_id'])): ?><figure class="am-thumbnail">
		                            	<img src="<?php echo ($workerModel['fullpath']); ?>">
		                            </figure><?php endif; ?>
		                    </div>
                		</div>
            		</div>
                    
                    <div class="am-margin">
                        <button type="submit" class="am-btn am-btn-success am-btn-xs ajax-post" target-form="am-form">
                            提交保存
                        </button>
                        <button type="button" class="am-btn am-btn-secondary am-btn-xs" onclick="javascript:history.back(-1);return false;">
                            返回列表
                        </button>
                        <input type="hidden" name="worker_id" value="<?php echo ($workerModel['worker_id']); ?>"/>
                        <!-- 后台新增自有团队成员时，初始状态为 5，待小哥使用手机端注册后变为 1正常状态 -->
                        <input type="hidden" name="status" value="<?php echo ((isset($workerModel['status']) && ($workerModel['status'] !== ""))?($workerModel['status']):'5'); ?>"/>
                    </div>
                </form>
    </div>

    </div>
</div>
<a class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu" data-am-offcanvas="{target: '#admin-offcanvas'}"
  style="z-index:980;"></a>
</body>

</html>

	<!-- /主体 -->

	<!-- 底部 -->
	<!-- 底部
================================================== -->
<footer>
</footer>
<script type="text/javascript">
    (function(){
        var ThinkPHP = window.Think = {
            "ROOT"   : "", //当前网站地址
            "APP"    : "/blovex4.php?s=", //当前项目地址
            "PUBLIC" : "/Public", //项目公共目录地址
            "DEEP"   : "<?php echo C('URL_PATHINFO_DEPR');?>", //PATHINFO分割符
            "MODEL"  : ["<?php echo C('URL_MODEL');?>", "<?php echo C('URL_CASE_INSENSITIVE');?>", "<?php echo C('URL_HTML_SUFFIX');?>"],
            "VAR"    : ["<?php echo C('VAR_MODULE');?>", "<?php echo C('VAR_CONTROLLER');?>", "<?php echo C('VAR_ACTION');?>"]
        }
    })();
</script>
<!--[if lt IE 9]>
    <script src="/Public/Blovex4/js/jquery-1.8.min.js"></script>
    <script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
	<script src="/Public/Blovex4/js/polyfill/rem.min.js"></script>
	<script src="/Public/Blovex4/js/polyfill/respond.min.js"></script>
    <script src="/Public/Blovex4/js/amazeui.legacy.js"></script>
<![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
    <script type="text/javascript" src="/Public/Common/js/jquery-2.0.3.min.js">
    </script>
    <script type="text/javascript" src="/Public/Common/js/amazeui.min.js">
    </script>
<!--<![endif]-->
<script src="/Public/Common/js/jquery.datetimepicker.js" type="text/javascript">
</script>
<script src="/Public/Blovex4/js/think.js" type="text/javascript">
</script>
<script src="/Public/Blovex4/js/custom.js" type="text/javascript">
</script>
<script src="/Public/Common/js/jquery.nicescroll.js" type="text/javascript">
</script>

<script src="/Public/Common/js/uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
<script src="/Public/Common/js/amazeui.datetimepicker.min.js" type="text/javascript"></script>
<script src="/Public/Common/js/ueditor/ueditor.config.js" type="text/javascript"></script>
<script src="/Public/Common/js/ueditor/ueditor.all.min.js" type="text/javascript"></script>
<script src="/Public/Common/js/ueditor/lang/zh-cn/zh-cn.js" type="text/javascript"></script>
<script type="text/javascript">
Think.setValue('sex',<?php echo ((isset($workerModel["sex"]) && ($workerModel["sex"] !== ""))?($workerModel["sex"]):1); ?>);
Think.setValue('job',<?php echo ((isset($workerModel["job"]) && ($workerModel["job"] !== ""))?($workerModel["job"]):1); ?>);
Think.setValue('site_id',<?php echo ((isset($workerModel["site_id"]) && ($workerModel["site_id"] !== ""))?($workerModel["site_id"]):1); ?>);

UE.getEditor("description",{
    toolbars:[[
    "fullscreen", '|', 'undo', 'redo', "|","bold", "italic", "underline", 'fontborder', 
    'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch',
    'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 
    'insertunorderedlist', 'selectall', 'cleardoc', "|", 
    'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
    'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
    'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', 'insertimage']],
    wordCount:false,enableAutoSave:false,elementPathEnabled:false
});

var nowTemp = new Date();
var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);

$('#training_time').datetimepicker({
    language: 'zh-CN',
    pickerPosition: 'top-right',
    startDate: now
})

//上传图片
/* 初始化上传插件 */
$("#pict_cover").uploadify({
    "height": 30,
    "width": 120,
    "swf": "/Public/Common/js/uploadify/uploadify.swf",
    "fileObjName": "download",
    "buttonText": "上传头像",
    "uploader": "<?php echo U('Attachment/uploadPhoto',array('session_id'=>session_id()));?>",
    "fileSizeLimit":'<?php echo ($fileSize); ?>B',
    'fileTypeExts': '*.jpg; *.png; *.gif',
    "onUploadSuccess": uploadPicture,
    "onSelectError":uploadify_onSelectError,
    "onUploadError":uploadify_onUploadError,
    'onFallback': function(){
        alert('未检测到兼容版本的Flash.');
    }
});

function uploadPicture(file, data){
	
    var data = $.parseJSON(data);
    var src = '';
    
    if (data.status) {
        $("#att_id").val(data.att_id);
        src = data.fullpath;
        $("#photo_thumbnail").html('<figure class="am-thumbnail"><img src="' + src + '"/></figure>');
    }else {
        updateAlert(data.info);
        setTimeout(function(){
            $('#top-alert').find('button').click();
            $(that).removeClass('disabled').prop('disabled', false);
        }, 1500);
    }
}


</script>


<!-- 用于加载js代码 -->


	<!-- /底部 -->
</body>
</html>